home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xpt / xpt.c < prev    next >
C/C++ Source or Header  |  1995-05-09  |  1KB  |  65 lines

  1. /**
  2.  *
  3.  *  xpt -- An X Periodic Table
  4.  *
  5.  * Written by Joel P. Lord 03/05/93
  6.  *
  7.  *    This software is available for free distribution,
  8.  * under the condition that this not be removed from the
  9.  * source code.
  10.  *
  11. **/
  12.  
  13. #define MAIN
  14. #include <stdio.h>
  15. #include "xpt.h"
  16.  
  17. main(argc, argv)
  18. int argc;
  19. char *argv[];
  20. {
  21.   Arg args[20];
  22.   int n = 0;
  23.   XGCValues gcv;
  24.  
  25.   toplevel = XtInitialize("xpt", "X Periodic Table",
  26.               NULL, 0, &argc, argv);
  27.  
  28.   p_disp = XtDisplay(toplevel);
  29.  
  30.   mfontstruct = (XFontStruct *)GetFont(HELV_MEDIUM_12);
  31.   BigFont = (XFontStruct *)GetFont(HELV_BOLD_24);
  32.   mfontheight = mfontstruct->max_bounds.ascent +
  33.     mfontstruct->max_bounds.descent;
  34.  
  35.   init_colors();
  36.  
  37.   XtSetArg(args[n], XtNfont, mfontstruct);
  38.   n++;
  39.   XtSetArg(args[n], XtNheight, 320);
  40.   n++;
  41.   XtSetArg(args[n], XtNwidth, 480);
  42.   n++;
  43.   XtSetArg(args[n], XtNbackground, mbgpix);
  44.   n++;
  45.   XtSetArg(args[n], XtNforeground, mfgpix);
  46.   n++;
  47.  
  48.   MainW = XtCreateManagedWidget("Xpt", formWidgetClass, toplevel, args, n);
  49.  
  50.   XtRealizeWidget(toplevel);
  51.  
  52.   theGC = (GC)CreateGC(XtWindow(MainW), mfontstruct, mfgpix, mbgpix);
  53.   BigGC = (GC)CreateGC(XtWindow(MainW), BigFont, mfgpix, mbgpix);
  54.  
  55.   init_table();
  56.  
  57.   done = 0;
  58.  
  59.   while (!done)
  60.     {
  61.       XtNextEvent(&theEvent);
  62.       XtDispatchEvent(&theEvent);
  63.     }
  64. }
  65.